﻿using System;
using System.Collections;
using System.Text;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Xml;
using System.Diagnostics;
using System.Threading;
using System.Text.RegularExpressions;

namespace VRP_Saving_Final
{
    class Program                                                
    {
        //I MADE THIS CHANGE AS A TEST BLAH BLAH//
		static void Main(string[] args)                         //Where the main program runs...starts and stops the clock
        {
            //string inputfile = args[0];                         //string inputfile = "test_instance.vrp";
            string inputfile = "A.vrp";                                                                          
            Stopwatch watch = new Stopwatch();                  //create a new stopwatch instance to record time
            watch.Start();                                      //start the stopwatch recording time
            VRP network = new VRP();                            //initialize the VRP class to initialize all routes and cost matrix,etc.
            network.lambda = 1.0F;                              //set lambda parameter
            input.readingdatafile(network, inputfile);          //calls input.cs in order to read the file
            if (network.error == true)                          //if there is an error in the input file, report it
            {
                Console.WriteLine("There is an error in the input file!");
                return;
            }
            Saving.Clark_Wright(network);                       //calls the Saving algorithm with the current input file specification 
            watch.Stop();                                       //after the algorithm is complet, stop the clock
            double elapsedMS = watch.ElapsedMilliseconds;       //compute the time in milliseconds
            RouteWrite.Outputroutes(network.routes, elapsedMS, network.objective, inputfile);       //output the results using the RouteWrite class

        }

    }
}
